package com.kinghood.productcenter.common.model.dto.product;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.kinghood.sharding.model.KingHoodDefaultSort;
import com.kinghood.sharding.model.KingPageReqDTO;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List;

/**
 * 业务日志查询dto
 *
 * @author jp
 * @date 2024/01/03
 */
@Data
public class BusinessLogQueryDTO  extends KingPageReqDTO implements KingHoodDefaultSort, Serializable {
    public static final String DEFAULT_COLUMN = "createTime";

    /**
     * 业务类型(1:商品，2:sku)
     */
    private Integer businessType;

    /**
     * 商品id
     */
    private Long productId;

    /**
     * 商品id
     */
    private Long skuId;

    /**
     * 操作类型
     * {@link com.kinghood.productcenter.common.model.enums.product.BusinessLogOperateEnum}
     */
    private Integer operate;

    /**
     * 操作人员
     */
    private String operator;
    private List<Long> userIdList;

    /**
     * 开始时间
     */
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    private LocalDateTime endTime;

    /**
     * id列表
     */
    private List<Long> idList;

    /**
     * 文件名
     */
    private String fileName;

    /**
     * sheet名称
     */
    private String sheetName;

    /**
     * 要下载字段
     */
    private List<String> downloadField;

    @Override
    public List<OrderItem> getDefaultSort() {
        OrderItem one = OrderItem.desc(DEFAULT_COLUMN);
        return Collections.singletonList(one);
    }

    @Override
    public List<OrderItem> getTailSort() {
        return null;
    }
}
